<template>
  <div class="not-found">
    <app-header />
    
    <div class="page-content">
      <div class="error-container">
        <h1>404</h1>
        <p>抱歉，您访问的页面不存在</p>
        <div class="actions">
          <el-button
            v-if="!isMobileDevice"
            type="primary"
            @click="goHome"
          >
            返回首页
          </el-button>
          <van-button
            v-else
            type="primary"
            @click="goHome"
          >
            返回首页
          </van-button>
        </div>
      </div>
    </div>

    <app-footer />
  </div>
</template>

<script setup>
import { ref } from 'vue'
import { useRouter } from 'vue-router'
import { isMobile } from '@/utils/device'
import AppHeader from '@/components/layout/AppHeader.vue'
import AppFooter from '@/components/layout/AppFooter.vue'

const router = useRouter()
const isMobileDevice = ref(isMobile())

const goHome = () => {
  router.push('/')
}
</script>

<style lang="scss" scoped>
.not-found {
  padding-top: 60px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;

  .page-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
  }
}

.error-container {
  text-align: center;
  padding: 40px;

  h1 {
    font-size: 6em;
    color: #409EFF;
    margin-bottom: 20px;
  }

  p {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 30px;
  }
}

// 移动端样式
@media screen and (max-width: 768px) {
  .error-container {
    padding: 20px;

    h1 {
      font-size: 4em;
    }

    p {
      font-size: 1em;
    }
  }
}
</style> 